import java.util.*;

public class Main {
    public int MoreThanHalfNum_Solution(int [] array) {
        Arrays.sort(array);
        return array[array.length/2];
    }















    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()){
            String s=scanner.nextLine();
            int len=s.length();
            StringBuilder sb=new StringBuilder();
            for(int i=0;i<len;i++){
                char ch=s.charAt(i);
                if(ch>='0'&&ch<='9'){
                    sb.append(ch);
                }else{
                    sb.append(" ");
                }
            }
            String str=sb.toString();
            String[] nums=str.split(" ");
            int max=0;
            for(int i=0;i<nums.length;i++){
                max=Math.max(max,nums[i].length());
            }
            for(int i=0;i<nums.length;i++){
                if(max==nums[i].length()){
                    System.out.println(nums[i]);
                }
            }
        }
    }
}
